package com.wordplat.quickstart.xutils.common.task;

/**
 * Created by wyouflf on 15/6/5.
 * 带有优先级的Runnable类型(仅在task包内可用)
 */
class PriorityRunnable implements Runnable {

    long SEQ;

    private final Runnable runnable;
    public final Priority priority;

    /**
     * PriorityRunnable
     *
     * @param priority
     * @param runnable
     */
    public PriorityRunnable(Priority priority, Runnable runnable) {
        this.priority = priority == null ? Priority.DEFAULT : priority;
        this.runnable = runnable;
    }

    @Override
    public final void run() {
        this.runnable.run();
    }
}
